home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / programs / ubbs208b.zip / UBBSFMTS.TXT < prev    next >
Text File  |  1991-07-25  |  39KB  |  972 lines

  1.                          UltraBBS v2.08 File Formats
  2.                                   07/25/91
  3.  
  4. Message File Format
  5. -------------------
  6.  
  7. In the messages file (extension ".DAT"), each record is 150 bytes long. The 
  8. first record in each messages file has the following format:
  9.  
  10. struct firstrecord
  11. {
  12.  long nextrecord;
  13.  long highmsgnum;
  14.  long lowmsgnum;
  15.  long lastfidomsgimported;
  16.  char reserved[134];
  17. }
  18.  
  19. The nextrecord variable contains the next record # that should be used in 
  20. the messages file (first record in file is record # 0).  The highmsgnum 
  21. variable contains the current high message number in the message base, and 
  22. lowmsgnum contains the current low message number in the message base.
  23. The lastfidomsgimported variable is used by the FIDOCVT program and
  24. is the number of the last message that was imported by FIDOCVT (or the
  25. last message that has already been exported to FIDO format).
  26.  
  27. The header of each message in the messages file has the following format:
  28.  
  29. struct msgrecord
  30. {
  31.  long msgnum;
  32.  unsigned char from[26];
  33.  unsigned char to[26];
  34.  unsigned char msgdate[9];
  35.  unsigned char msgtime[6];
  36.  unsigned char subject[26];
  37.  unsigned char msgpass[21];
  38.  unsigned char active;
  39.  long referto;
  40.  unsigned char datercvd[9];
  41.  unsigned char records;
  42.  unsigned char private;
  43.  unsigned char timercvd[6];
  44.  unsigned char echoflag;
  45.  unsigned char rr;
  46.  unsigned char perm;
  47.  unsigned char attached;
  48.  int hasreplies;
  49.  unsigned char reserved[4];
  50. }
  51.  
  52. All character arrays ("strings") are NULL TERMINATED character arrays!  
  53. They are NOT padded with spaces!  This applies for the rest of this file, 
  54. except where specifically stated otherwise.  Whatever follows the null byte 
  55. is of no consequence, it is ignored.
  56.  
  57. The msgnum variable is the number of this message.  The from variable
  58. is the name of the user who entered the message.  The to variable is
  59. the name of the user to whom the message was entered.  The msgdate variable
  60. is the date on which the message was entered ("MM/DD/YY" format).  The
  61. msgtime variable is the time on which the message was entered ("HH:MM"
  62. format).  The subject variable is the subject of the message.  The msgpass
  63. variable is the password of the message, it should be null if there is no
  64. password on the message.  The active variable is nonzero if the message is
  65. active, zero if the message is killed.  The referto variable contains the
  66. message number of the message which this message is a reply off of, 0
  67. if this message is not a reply to any other message.  The datercvd variable
  68. contains the date on which this message was received ("MM/DD/YY" format),
  69. it should be a 0 length string if the message has not been received yet.  
  70. The records variable contains the # of records in the message's text area 
  71. (it does NOT include the header!).  The private variable is nonzero if the 
  72. message is receiver only, or zero if it is public or password protected.  
  73. The timercvd variable contains the time on which this message was received 
  74. ("HH:MM" format), it should be a 0 length string if the message has not been
  75. received yet.  The echoflag variable is used only for conferences designated
  76. as 'echo' conferences.  If nonzero, it is assumed that the message is
  77. supposed to be exported for echomail, if zero, it should stay only in the
  78. local message base.  The rr variable is nonzero if the user has requested a
  79. return receipt, zero if he has not (a return receipt is generated when the 
  80. message is first received, the rr flag is NOT changed).  The perm variable 
  81. is nonzero if the message cannot be killed by the receiver, zero if it can 
  82. (this should only be used on public messages).  The attached variable is 
  83. nonzero if a file is attached to the message, zero if a file is not 
  84. attached.  The hasreplies variable is nonzero if the message has replies
  85. to it, otherwise it is set to zero.  The reserved variable is used for
  86. future use and should be set to all nulls. If a file is attached, it will
  87. be placed in a subdirectory off of your attach directory named
  88. MSGNUMBER.CONF (for example, ATTACHDIR\1.0\filename.ext for message # 1 in
  89. conference # 0).
  90.  
  91. The actual text records of the message (following each header) are strings
  92. of text, each representing a line of the message, followed by (Ctrl-A)
  93. characters.  The very last (Ctrl-A) of the message (representing the
  94. (Enter) on the last line of the message) is followed by a (Ctrl-B)
  95. character.  The rest of the current record is padded out by unpredictable
  96. characters to the next 150-byte boundary.
  97.  
  98. The records in the messages index file (extension ".NDX") have the 
  99. following format:
  100.  
  101. struct messageindexrecord
  102. {
  103.  long record;
  104.  unsigned char to[26];
  105.  unsigned char from[26];
  106.  unsigned char private;
  107.  unsigned char active;
  108.  unsigned char subject[26];
  109. }
  110.  
  111. The index begins at the low message number specified in the first record of 
  112. the message file.  The long integer is the record # in the messages file of 
  113. the message it represents (first record in file is record # 0 again). For 
  114. example, if the low message number is 5, and you wanted to find message # 5 
  115. in the messages file, you would look at the first record in the index file 
  116. to get message # 5's record in the messages file.  The to, from, private, 
  117. active, and subject fields should correspond to those fields in that 
  118. message's actual header.  Since the index file is based on the lowmsgnum 
  119. variable, you will not want to change the lowmsgnum variable at any time 
  120. unless your program does a complete pack of the message files.
  121.  
  122. FileBase File Format
  123. --------------------
  124.  
  125. In the FileBase data file (extension ".DAT"), each record is 338 bytes 
  126. long.  Each file entry in the file has the following format:
  127.  
  128. struct filerecord
  129.  unsigned char file[13];
  130.  unsigned long filesize;
  131.  unsigned char uploadedby[26];
  132.  int timesdled;
  133.  unsigned char filelocation[41];
  134.  unsigned char lastdl[9];
  135.  unsigned char dateoful[9];
  136.  int freefile;
  137.  unsigned char id[5];
  138.  unsigned char descrip[225];
  139.  int deleteflag;
  140. }
  141.  
  142. The file variable contains the actual file name of the file on the BBS.  
  143. The filesize variable contains the size (in bytes) of the file on disk, or
  144. 0 if the file has a "variable" size.  The uploadedby field contains the full
  145. name of the user who uploaded the file.  The timesdled field contains the
  146. number of times that this file has been downloaded.  The filelocation
  147. variable contains the actual physical location of the file (on the disk
  148. drive).  The lastdl and dateoful fields contain (in "MM/DD/YY" format) the
  149. last date the file was downloaded, and the date that the file was uploaded,
  150. respectively.  The freefile variable is nonzero if the file is free (no
  151. download charge), or zero if not.  The idvariable contains the 4 character
  152. Directory ID of the file.  The descrip variable contains the description of
  153. the file (5 lines, 45 characters each).  The descrip variable is NOT null
  154. terminated and is padded with spaces!  The deleteflag variable is nonzero
  155. if the file is flagged for deletion, zero if not.
  156.  
  157. The FileBase index files have a one-character extension that is the first 
  158. letter in their file name.  The records in the FileBase index files have 
  159. the following format:
  160.  
  161. struct fileindexrecord
  162. {
  163.  unsigned char file[13];
  164.  unsigned char id[5];
  165.  long record;
  166.  long binarydate;
  167. }
  168.  
  169. The file variable contains the file name of the file.  The id variable 
  170. contains the 4 character Directory ID of the file.  The record variable 
  171. contains the actual record (again, first record in data file is # 0) in the 
  172. FileBase data file where complete information on the file is stored.  The 
  173. binarydate field contains the file's date as a long integer.  This value is 
  174. obtained by rearranging the fields of the date to YYMMDD and then taking
  175. the value into a long integer (ie: 10/12/90 = 901012).
  176.  
  177. User File Format
  178. ----------------
  179.  
  180. In the Users data file (extension ".DAT"), each record is 1695 bytes 
  181. long.  Each user entry in the file has the following format:
  182.  
  183. struct userrecord
  184. {
  185.  unsigned char name[26];
  186.  unsigned char userpass[21];
  187.  int security;
  188.  int expert;
  189.  unsigned char city[21];
  190.  unsigned char lastdate[9];
  191.  unsigned char lasttime[6];
  192.  unsigned char newfchk[9];
  193.  int downloads;
  194.  int uploads;
  195.  int elapsedmins;
  196.  unsigned char page;
  197.  unsigned char voice[14];
  198.  unsigned char data[14];
  199.  unsigned char protocol;
  200.  int timeson;
  201.  unsigned int doorsent;
  202.  unsigned int msgsent;
  203.  unsigned char confs[25];
  204.  long lastmsg[200];
  205.  unsigned char expiredate[9];
  206.  int expiresec;
  207.  unsigned char econfs[25];
  208.  unsigned char birthdate[9];
  209.  unsigned char sysopcomment[61];
  210.  unsigned char fileforuser[41];
  211.  unsigned char autopage;
  212.  unsigned char userscanconfs[25];
  213.  int deleteuser;
  214.  unsigned char reserved2;
  215.  double kuploaded;
  216.  double kdownloaded;
  217.  unsigned char fsdefault;
  218.  int clrscrn;
  219.  int timestored;
  220.  long kbytesdled;
  221.  unsigned char reserved[6];
  222. }
  223.  
  224. The name variable is the full name of the user.  The userpass variable 
  225. contains the user's password.  The security variable contains the user's 
  226. security level.  The expert variable is nonzero if the user has turned on 
  227. expert mode, zero if not.  The city variable contains the user's 
  228. city/state.  The lastdate and lasttime variables (in "MM/DD/YY" and "HH:MM" 
  229. form, respectively) contain the last date and last time on which the user 
  230. called the BBS.  The newfchk variable (in "MM/DD/YY" format) contains the 
  231. last date that the user checked for new files.  The downloads and uploads 
  232. variables contain the number of downloads and uploads the user has done on 
  233. the BBS.  The elapsedmins field contains the elapsed minutes that the user 
  234. has spent on the BBS in all his calls on the last date he called.  The page 
  235. variable contains the user's screen page length.  The voice and data 
  236. variable contains the user's voice and data phone numbers, respectively.  
  237. The protocol variable contains the user's default transfer protocol.  The 
  238. timeson, doorsent, and msgsent variables contain the number of times the 
  239. user has logged on, the number of doors he has opened, and the number of 
  240. messages he has entered, respectively.  The confs variable is a 25-byte
  241. (NOT null terminated) field that consists of 200 bits, each representing
  242. one conference in the user's conference string (for example, bit 0 of the
  243. first byte is conference 0, bit 2 of the second byte is conference 10).
  244. The lastmsg[] array is a 200-element array of long integers, representing the
  245. last message number read in each conference (0-199).  The expiredate (in 
  246. "MM/DD/YY" format) contains the date on which the user's subscription will 
  247. expire ("00/00/00" means it won't expire).  The expiresec variable contains 
  248. the security level to set this user to after his subscription expires.  The 
  249. econfs variable is the same format as the confs variable described above, 
  250. but is the conference string to set the user to after his subscription 
  251. expires.  The birthdate variable contains the date (in "MM/DD/YY" format) 
  252. on which the user was born.  The sysopcomment variable contains the comment 
  253. which the sysop has put on this user.  The fileforuser variable contains 
  254. the name of a file to display to the user upon login (a 0 length string if 
  255. no file should be displayed).  The autopage character should be set to 
  256. 'N', 'I', or 'V'.  An 'N' means that no autopage will be done when this 
  257. user logs on.  If it is set to 'I' or 'V', an invisible or visible 
  258. (respectively) autopage will be executed when the user logs in.  The 
  259. userscanconfs variable works the same way as the two conference variables 
  260. mentioned above.  It defined the conferences that will be scanned upon 
  261. login, with the (Y) command, with (R A), for offline reading, etc.  The 
  262. deleteuser variable, if set to a nonzero value, means the user is marked 
  263. for deletion, otherwise the user is not marked for deletion.  The reserved2 
  264. variable is reserved for future use and should be left alone.  The 
  265. kuploaded and kdownloaded variables (stored as double precision values in 
  266. IEEE format) store the number of kilobytes (bytes / 1024) that the user has 
  267. uploaded and downloaded, respectively.  The fsdefault variable should be 
  268. set to a value of 0, 1, or 2.  A 0 means to ask the user if he wishes to 
  269. use the full screen editor each time he enters a message.  A 1 means that 
  270. the user wishes to use the full screen editor whenever possible, and a 2 
  271. means to not use it whenever possible.  The clrscrn variable, if set to a 
  272. nonzero value, means that the user wishes the screen to be clear prior to 
  273. reading each message; otherwise, the screen is not cleared.  The timestored 
  274. variable stored the amount of time (in minutes) that the user has stored in 
  275. the time bank.  The kbytesdled variable stores the number of kilobytes that
  276. the user had downloaded on his last date on.  The reserved variable is
  277. reserved for future use and must be set to all nulls.
  278.  
  279. The User File index files have a one-character extension that is the first 
  280. letter in the full name of the user.  The records in the user index files 
  281. have the following format:
  282.  
  283. struct userindexrecord
  284. {
  285.  unsigned char username[26];
  286.  long record;
  287. }
  288.  
  289. The username field is the full name of the user, and the record field is 
  290. the record (again, record # 0 is the first record in the data file) in the 
  291. users data file of this user.
  292.  
  293. Conferences Data File Format
  294. ----------------------------
  295.  
  296. In the conferences data file, each record is 2717 bytes long.  The first 
  297. record in the file contains the information for Conference # 0, the second 
  298. record contains the information for Conference # 1, and so on.  The format 
  299. of each record is as follows:
  300.  
  301. struct confrecord
  302. {
  303.  unsigned char confname[41];
  304.  int allowalias;
  305.  int echoconf;
  306.  int allowesc;
  307.  int maxdir;
  308.  unsigned char msgsfile[41];
  309.  unsigned char mainmenufile[41];
  310.  unsigned char sysopmenufile[41];
  311.  unsigned char newsfile[41];
  312.  unsigned char uploaddir[31];
  313.  int defaultfiledir;
  314.  unsigned char doormenu[41];
  315.  unsigned char doorlst[41];
  316.  unsigned char bltmenu[41];
  317.  unsigned char bltlst[41];
  318.  unsigned char quesmenu[41];
  319.  unsigned char queslst[41];
  320.  unsigned char dirmenu[41];
  321.  unsigned char votingmenu[41];
  322.  unsigned char votinglst[41];
  323.  int allowupload;
  324.  struct dirinfo
  325.  {char dirid[5];
  326.   int dirsec;
  327.  } dir[300];
  328. }
  329.  
  330. The confname variable is the name of this conference.  The allowalias 
  331. variable, if set to nonzero means that aliases will be allowed in this 
  332. conference, else aliases will not be allowed.  If echoconf is nonzero, then 
  333. this conference is designated as 'echo', and users entering messages will 
  334. be prompted as to whether they wish to make their messages 'echo' or not.  
  335. If allowesc if nonzero, then users are allowed to use ESC (usually ANSI) 
  336. codes in their messages.  The maxdir variable contains the highest 
  337. directory number in this conference.  The msgsfile variable contains the 
  338. name (without extension) of the message file for this conference.  The 
  339. mainmenufile, sysopmenufile, newsfile, and uploaddir variables contain the 
  340. names for the main menu file, the sysop menu file, the news file, and the 
  341. directory to place uploads, respectively.  The defaultfiledir variable 
  342. stores the default file directory number to place uploaded files in.  The 
  343. doormenu, doorlst, bltmenu, bltlst, quesmenu, queslst, dirmenu, votingmenu, 
  344. and votinglst variables contain the file names of the door menu, door data 
  345. file, bulletins menu, bulletins data file, questionnaire menu, 
  346. questionnaire data file, file directory menu, voting booths menu, and 
  347. voting booths data file.  If the allowupload variable is zero, then uploads 
  348. will not be allowed in this conference.  The dir[] array is an array of 300 
  349. structures, each containing a 4 character directory ID and the security 
  350. required to download files from that directory ID.  All elements of dir[] 
  351. above the maxdir number are ignored.  
  352.  
  353. NODEINFO File Format
  354. --------------------
  355.  
  356. The NODEINFO file contains 99 records, each corresponding to a node on the 
  357. system.  Any records above your highest node number are ignored, but should 
  358. still be there.  The format of each node's record is as follows (71 byte
  359. record length):
  360.  
  361. struct noderecord
  362. {
  363.  unsigned char status;
  364.  unsigned char groupsummons;
  365.  unsigned char nodepage;
  366.  unsigned char nodebeeps;
  367.  unsigned char lasteventdate[9];
  368.  unsigned char lasteventtime[6];
  369.  unsigned char nodeuser[26];
  370.  unsigned char logoffflag;
  371.  unsigned char nodedoor[21];
  372.  int exittodos;
  373.  int lasteventnumber;
  374.  int pagingsysop;
  375. }
  376.  
  377. The status variable contains the status of this node.  Possible values are 
  378. as follows:
  379.    0 = UltraBBS isn't loaded on this node
  380.    1 - 99 = User is in a private (1-99) channel in node chat
  381.    100 = User is available for chat
  382.    101 = User is unavailable for chat
  383.    102 = User is entering a message
  384.    103 = User is in a door
  385.    104 = User is in remote DOS
  386.    105 = User is transferring a file
  387.    108 = User is in main channel of node chat
  388.    109 = This node is waiting for calls
  389.    110 = User is chatting with sysop
  390.    111 = User is logging onto BBS (not at main menu yet)
  391. The groupsummons variable is nonzero if this node is being summoned to 
  392. group chat.  After displaying the summons to the user, this flag is set to 
  393. zero.  The nodepage and nodebeeps variables record the state of the page 
  394. bell and beeps on this node (nonzero = on, zero = off).  The lasteventdate 
  395. and lasteventtime variables (in "MM/DD/YY" and "HH:MM" formats) store the 
  396. date and time of the last event run on this node.  The nodeuser variable 
  397. stores the user name of the user on this node.  The logoffflag variable, if 
  398. set to 1, it means that the user on this node has a logoff pending.  If it 
  399. is set to 2, it means that the user on this node has a lockout pending.  
  400. The nodedoor variable stores the name of the door that the user on this 
  401. node is in, if he is in a door.  The exittodos variable, if nonzero, means 
  402. that this node should exit to DOS after the current caller, or if no caller 
  403. is online, it should exit to DOS immediately.  The lasteventnumber 
  404. variable stores the number of the last event that was executed.  The
  405. pagingsysop variable is nonzero if the user is currently paging the sysop,
  406. zero if he is not.
  407.  
  408. Callers File Format
  409. -------------------
  410.  
  411. The callers file for each node is created by taking the name specified in 
  412. the SETUP program, and appending the current node number (for example, if 
  413. Node 1's callers log would be CALLER1, then Node 99's callers log would be 
  414. CALLER99).  Each entry in the callers log is exactly 79 bytes long.  The 
  415. last two bytes are a CR/LF sequence (ASC 13, ASC 10).  The file, when 
  416. TYPEd, appears to be a text file, but must NOT be modified as a text file!
  417.  
  418. Doors Data File Format
  419. ----------------------
  420.  
  421. The first record in the doors data file is door # 1, the second record is 
  422. door # 2, etc.  The format of each record is as follows (98 byte record 
  423. length):
  424.  
  425. struct doorrecord
  426. {
  427.  unsigned char doorname[21];
  428.  unsigned char doorfile[41];
  429.  int doorsec;
  430.  unsigned char doorpass[21];
  431.  unsigned char doortype[11];
  432.  int doorwatch;
  433. }
  434.  
  435. The doorname variable contains the name of this door.  The doorfile 
  436. variable contains the full path (and any parameters) to the .BAT file for 
  437. this door. The doorsec variable contains the security level required to 
  438. access this door.  The doorpass variable contains the password required to 
  439. access this door (a 0 length string if no password is required).  The 
  440. doortype variable contains the door type which will be used for the CONVERT 
  441. program.  The doorwatch variable, if nonzero, means that the FOSSIL will 
  442. reboot the computer if the user hangs up in this door.
  443.  
  444. Questionnaires Data File Format
  445. -------------------------------
  446.  
  447. The first record in the questionnaires data file is questionnaire # 1, the 
  448. second is questionnaire # 2, etc.  The format of each record is as follows 
  449. (126 byte record length):
  450.  
  451. struct quesrecord
  452. {
  453.  unsigned char quesname[21];
  454.  unsigned char quesfile[41];
  455.  unsigned char ansfile[41];
  456.  int quessec;
  457.  unsigned char quespass[21];
  458. }
  459.  
  460. The quesname variable is the name of this questionnaire.  The quesfile and 
  461. ansfile variables are the file names of the questionnaire script file, and 
  462. the output answers file, respectively.  The quessec variable is the 
  463. security required to answer this questionnaire, and the quespass variable 
  464. is the password that is required (a 0 length string means no passworD).
  465.  
  466. Voting Booths Data File Format
  467. ------------------------------
  468.  
  469. The first record in the voting booths data file is voting booth # 1, the 
  470. second is voting booth # 2, etc.  The format of each record is as follows 
  471. (1388 byte record length):
  472.  
  473. struct votingrecord
  474. {
  475.  unsigned char votingname[46];
  476.  unsigned char datafile[41];
  477.  int votingsec;
  478.  unsigned char votingpass[21];
  479.  unsigned char choices[18][71];
  480. }
  481.  
  482. The votingname variable is the question presented by this voting booth.  
  483. The datafile variable contains the name of the voting results data file for 
  484. this voting booth.  The votingsec & votingpass variables contain the 
  485. security required for this voting booth, and the password required for the 
  486. booth (0 length password means no password).  The choices[] array is an 18 
  487. element array containing strings of the 18 possible responses.
  488.  
  489. Bulletins Data File Format
  490. --------------------------
  491.  
  492. The first record in the bulletins data file is bulletin # 1, the second 
  493. record is bulletin # 2, etc.  The format of each record is as follows (64 
  494. byte record length):
  495.  
  496. struct bltrecord
  497. {
  498.  unsigned char bltfile[41];
  499.  unsigned char bltpass[21];
  500.  int bltsec;
  501. }
  502.  
  503. The bltfile variable contains the file name of the actual bulletin.  The 
  504. bltpass & bltsec variables contain the password (0 length means no 
  505. password) and the security required to access this bulletin.
  506.  
  507. No Uploads File Format
  508. ----------------------
  509.  
  510. The format of a record in the no uploads file is as follows (43 byte record 
  511. length):
  512.  
  513. struct nouprecord
  514. {
  515.  unsigned char file[41];
  516.  int upsecurity;
  517. }
  518.  
  519. The file variable is the wildcard specification for this entry.  The 
  520. upsecurity variable contains the minimum security level required to upload 
  521. a file that matches the wildcard spec.
  522.  
  523. Compression Methods Data File Format
  524. ------------------------------------
  525.  
  526. The first record in the compression methods data file will be the default 
  527. compression method for use in Qmail packets.  The format for each entry is 
  528. as follows (224 byte record length):
  529.  
  530. struct comprecord
  531. {
  532.  unsigned char ext[4];
  533.  unsigned char viewform[51];
  534.  unsigned char addform[51];
  535.  unsigned char getform[51];
  536.  unsigned char testform[51];
  537.  unsigned char badtext[16];
  538. }
  539.  
  540. The ext variable contains the 3 character extension used by this 
  541. compression method.  The viewform, addform, getform, and testform store the 
  542. command line needed to execute the various functions.  See the UltraBBS 
  543. sysop documentation for more information on what these strings should look 
  544. like.  The badtext variable contains the text that the compressor will 
  545. display if a file is bad during an integrity check.
  546.  
  547. Protocols Data File Format
  548. --------------------------
  549.  
  550. The format of each record in the protocols data file is as follows (109 
  551. byte record length):
  552.  
  553. struct protrecord
  554. {
  555.  unsigned char letter;
  556.  unsigned char batch;
  557.  unsigned char uload[41];
  558.  unsigned char dload[41];
  559.  unsigned char protname[21];
  560.  int atsign;
  561.  int dszlog;
  562. }
  563.  
  564. The letter variable is the letter used to select this protocol from the 
  565. BBS.  The batch variable should be set to 'S', 'M', or 'B' for single file, 
  566. multiple files, or bidirectional multiple files.  The uload and dload 
  567. variables store the name of the batch file for uploads and downloads, 
  568. respectively (dload variable is used for bidirectional transfer batch 
  569. files).  The protname variable contains the name of this protocol.  The 
  570. atsign variable, if nonzero, means that this protocol supports the 
  571. '@listfile' command line parameter, to transfer up to 99 files instead of 
  572. just 6 or 7.  The dszlog variable, if nonzero, means that this protocol 
  573. will write a DSZ.LOG file after a download.
  574.  
  575. Limits Data File Format
  576. -----------------------
  577.  
  578. The format of each record in the limits data file is as follows (14 byte
  579. record length):
  580.  
  581. struct limitsrecord
  582. {
  583.  int limitssec;
  584.  int limitsmins;
  585.  int kbytesperup;
  586.  int filesperup;
  587.  int doornumber;
  588.  long kbytesperday;
  589. }
  590.  
  591. The limitssec variable is the security for which this record applies.  The 
  592. limitsmins variable is the number of minutes that this security level will 
  593. get each day.  The kbytesperup (stored as a double precision IEEE format 
  594. number) and filesperup variables determine how many Download Kilobytes the 
  595. user may have for each 1 Upload Kilobyte; and the number of Download Files 
  596. the user may have for each 1 Upload File.  To negate the function of 
  597. either, set it to 0.  The doornumber variable contains the door number 
  598. which will be automatically opened when any user of this security level 
  599. logs on.  The kbytesperday variable stores the number of kilobytes that
  600. a user of this security level can download per day.
  601.  
  602. Voting Results Data File Format
  603. -------------------------------
  604.  
  605. A voting results data file contains records 27 bytes in length for each 
  606. user who has voted (a user will not appear more than once in the file).  
  607. The format of each record is as follows:
  608.  
  609. struct votedrecord
  610. {
  611.  unsigned char name[26];
  612.  unsigned char choice;
  613. }
  614.  
  615. The name variable is the name of the user to which this vote applies, and 
  616. the choice variable is the choice number which he voted for.
  617.  
  618. Node Chat Data File Format
  619. --------------------------
  620.  
  621. Each record (one character typed in node chat) is 3 bytes in the node chat 
  622. data file.  The first byte of the record is a char that should be set to 
  623. the channel # that this message is going through (0-99).  If the record is 
  624. representing a character, then the second byte of the record should be set 
  625. to the number of the node that is sending the character, and the third byte 
  626. should be set to the actual character.  If the record is to notify of an 
  627. exit/entrance/hangup/etc, then the second byte should be set to 253 for a 
  628. force off (hang up, etc), 254 for an entrance, and 255 for an exit; and the 
  629. third byte should be set to the node number to which this 
  630. exit/entrance/hangup applies to.
  631.  
  632. UBBS.SYS Door Exit File Format
  633. ------------------------------
  634.  
  635. The UBBS.SYS file is created before exiting to a door, and is read back in 
  636. by UltraBBS upon returning to obtain info about who is on.  This file is 
  637. usually just used by CONVERT to make other, more commonly used, door files, 
  638. but some software authors may wish to use it to alter user information, or 
  639. obtain more detailed, UltraBBS-specific information.  Its format is as 
  640. follows:
  641.  
  642. struct ubbs_sysfile
  643. {
  644.  long modembaud;
  645.  long callerbaud;
  646.  int eight_bit;
  647.  char time_on[6];
  648.  char date_on[9];
  649.  int kbytesperup;
  650.  int filesperup;
  651.  long kbytesperday;
  652.  int graphics;
  653.  long userpos;
  654.  int local_user;
  655.  int confnum;
  656.  char confsjoined[200];
  657.  char prevdate[9];
  658.  char prevtime[6];
  659.  int disable_remote;
  660.  int available;
  661.  long logon_time;
  662.  long secs_session;
  663.  long elapsedsecs;
  664.  long eventadjust;
  665.  char markedfiles[99][13];
  666.  unsigned char markednum;
  667.  char oldfchk[9];
  668.   -------------------- Variables below this line are write-only.  UltraBBS
  669.                        does not read them in upon returning from a door.
  670.                        If you wish to modify other variables, do so in the
  671.                        users file!               
  672.  char bbsname[31];
  673.  char sysopname[26];
  674.  char curtime[6];
  675.  char page_bell;
  676.  char beeps;
  677.  int junk;
  678.  long timeused;
  679.  char eventtime[6];
  680.  int eventactive;
  681.  int port;
  682.  char usermixed[26];
  683.  int minsremaining;
  684.  char node;
  685.  struct user currentuser;
  686. }
  687.  
  688. The modembaud variable contains the actual bps rate (locked bps rate) of 
  689. the port.  The callerbaud variable contains the bps rate the caller is 
  690. actually communicating at.  eight_bit is nonzero if the caller is 8N1, zero 
  691. if 7E1.  The time_on string contains the time at which the caller logged on 
  692. (HH:MM format), and date_on contains the date at which he logged on 
  693. (MM/DD/YY format).  kbytesperup and filesperup contain the number of 
  694. kilobytes that this user may download per kilobyte he uploads, and files he 
  695. may down per file he uploads (a value of 0 sets these to unlimited).  The 
  696. graphics variable is 0 if (N)o graphics, 1 if (B)lack & White graphics, 2 
  697. if (C)olor graphics.  The userpos variable contains the user's position in 
  698. the user file (the first record in user file is rec # 0).  local_user is 
  699. nonzero if the user is on local, zero if remote.  confnum contains the 
  700. current conference number the user is in.  confsjoined is a non-null 
  701. terminated string that contains spaces or 'X's, specifying which 
  702. conferences the user has joined during the current call.  The prevdate and 
  703. prevtime variables (MM/DD/YY and HH:MM) contain the date and time of the 
  704. user's last call (before this one).  disable_remote if nonzero if the 
  705. remote user's keyboard is disabled, zero otherwise.  available is nonzero 
  706. if the user is available for chat, zero otherwise.  logon_time contains the 
  707. seconds at which the user logged in (# of seconds elapsed since 00:00:00 
  708. Greenwich mean time, January 1, 1970).  secs_session contains the number of 
  709. seconds this user has per call (obtained from LIMITS.DAT).  elapsedsecs is 
  710. the number of seconds this user has used in calls earlier today.  
  711. eventadjust is the number of seconds the user has lost today because of 
  712. time adjustments due to upcoming events.  markedfiles is an array of 
  713. strings (containing 99 strings) containing which files the user has marked 
  714. to download via the (FL) command.  markednum contains the number of files 
  715. the user has marked.  oldfchk contains the last date (MM/DD/YY format) 
  716. which the user checked for new files.  bbsname contains the name of the 
  717. BBS.  sysopname is the name of the sysop, in all caps.  The curtime 
  718. variable contains the time (HH:MM format) that this UBBS.SYS file was 
  719. created.  The page_bell variable is true (nonzero) if the page bell is on, 
  720. zero if it's off.  beeps is nonzero if beeps/music is on, zero otherwise.  
  721. The junk variable is not used.  timeused contains the amount of time (in 
  722. seconds) the user has used so far today.  eventtime contains the time 
  723. (HH:MM format) of the next event.  eventactive is nonzero if any events are 
  724. configured, zero otherwise.  port contains the COM port number of the 
  725. current COM port (0=COM1, 1=COM2, 2=COM3, etc).  usermixed contains the 
  726. mixed case name of the user (ie: 'Bob Farmer').  minsremaining contains the 
  727. time, in minutes, that the user has remaining as of the creation of this 
  728. UBBS.SYS file.  This variable can be used, possibly in conjunction with the 
  729. curtime variable, to quickly obtain a time left calculation.  The node 
  730. variable contains the node # of this node.  The currentuser structure is in 
  731. the same format as a record in the user file (see above), and contains the 
  732. user record of the current user.
  733.  
  734. Caller Number Data File Format
  735. ------------------------------
  736.  
  737. The caller number data file is 4 bytes, and simply contains a single
  738. long integer which is the number of calls made to the system.
  739.  
  740. UltraBBS's UBBS.DAT File Format
  741. -------------------------------
  742.  
  743. The UBBS.DAT file is a line-by-line, sequential text file maintained by the
  744. SETUP program.  The lines, in order, are as follows:
  745.  
  746. Maximum # of Messages for (O) and (D C)
  747. Event # 1 Guard Time
  748. Event # 2 Guard Time
  749. Event # 3 Guard Time
  750. Security to Edit His Own Messages
  751. Use BIOS Output?
  752. Security for (6)
  753. BBS Listing Data File Name
  754. Security for (BB)
  755. Use Terse Caller Logging?
  756. Caller Number File Name
  757. Number of Rings to Skip Before Answering
  758. Instant Logon Password
  759. Event # 2 Active?
  760. Event # 3 Active?
  761. Event # 2 Time
  762. Event # 3 Time
  763. Security for (11)
  764. Security for (TI)
  765. Maximum Storable Time in (TI)
  766. Check Message 'To' Field?
  767. Delete the File For User?
  768. Birthday File Name
  769. Security for (10)
  770. Start of SysOp Page Hours
  771. End of SysOp Page Hours
  772. Holding Directory Name
  773. Scratch Directory Name
  774. No New Users File Name
  775. FileBase File Name
  776. Help Prefix File Name
  777. Conference Data File Name
  778. Conference Menu File Name
  779. Caller File Prefix File Name
  780. Node Chat File Name
  781. Welcome File Name
  782. Goodbye File Name
  783. Limits Data File Name
  784. NODEINFO Data File Name
  785. Protocols Data File Name
  786. User Data File Name
  787. No Registration File Name
  788. No Uploads Data File Name
  789. Low Security File Name
  790. New User File Name
  791. Remote DOS Batch File Name
  792. Aliases Data File Name
  793. User Security Files Path Name
  794. Event # 1 Time
  795. BBS Name
  796. SysOp's Name
  797. Initialization Command
  798. Answer Command
  799. Off-Hook Command
  800. Batch Directory Name
  801. Public Conferences String (exactly 200 chars)
  802. New User Questionnaire File
  803. New User Answers File
  804. Expired Subscription File Name
  805. Compression Data File Name
  806. Post-Upload Batch File Name
  807. Node Number
  808. Communications Port
  809. Allow New Users?
  810. Security to Overwrite Files
  811. RTS/CTS Checking?
  812. Test Uploads?
  813. Security for (M)ultiple Copy Save
  814. Security to Read Killed Messages
  815. Security to Edit/Move Messages
  816. Security to Kill Any Messages
  817. Security to Skip Message Password
  818. Security to Leave Message To SysOp
  819. Initialization Baud Rate
  820. Page Bell FIle Name
  821. Private Directory ID
  822. Security for (G X)
  823. Highest Node Number
  824. Minimum Security to Logon
  825. Security to Classify Files
  826. Use Post-Upload Batch File?
  827. New User Security
  828. Allow Aborting of Welcome?
  829. Lowest Baud Rate Allowed
  830. Seconds Allowed for Registration
  831. Security to Read Private Messages
  832. Seconds Between Node Checks
  833. SysOp Menu Security
  834. Upload Time Credit Factor
  835. Seconds of Idle Time Allowed
  836. Security to Edit Any Description
  837. Security to Import File into Message
  838. Lock Baud Rate?
  839. Allow 7E1 Callers?
  840. Event # 1 Active?
  841. Shell to Doors?
  842. Reboot on DOS Hangup?
  843. Shell to DOS?
  844. Security for (NO)/(CH)
  845. Security for (B)
  846. Security for (W)
  847. Security for (OP)/(DO)
  848. Security for (G)
  849. Security for (I)
  850. Security for (J)
  851. Security for (K)
  852. Security for (O)
  853. Security for (P)
  854. Security for (Q)
  855. Security for (R)
  856. Security for (S)
  857. Security for (US)
  858. Security for (V)
  859. Security for (X)
  860. Security for (Y)
  861. Security for (1)
  862. Security for (2)
  863. Security for (3)
  864. Security for (4)
  865. Security for (5)
  866. Security for (7)
  867. Security for (8)
  868. Security for (BI)
  869. Security for (D)
  870. Security for (ED)
  871. Security for (U)
  872. Security for (Z)
  873. Security for (VI)
  874. Security for (RE)
  875. Security for (F)
  876. Security for (N)
  877. Security for (E)
  878. Security to Page Unavailable Users
  879. Security for (WH)
  880. Security for (L)
  881. Security to Request Return Receipt
  882. Security to Forward a Message
  883. Pre-Upload File Name
  884. Qmail Offline ID
  885. BBS City/State
  886. BBS Phone Number
  887. Qmail Menu File Name
  888. Security for (FL)
  889. File Attach Directory Name
  890. Allow Non-2-Word Names?
  891. Continue After Modem Init Failure?
  892. Security for (9)
  893.  
  894. Information for BASIC Programmers
  895. ---------------------------------
  896.  
  897. All numbers are stored in IEEE format.  Variable information:
  898.  
  899. An 'unsigned char' or a 'char' is a numerical value stored in one byte.  To 
  900. convert it to BASIC, read it in as a 1-character string (A$, for example), 
  901. then, to get its value into a variable, (A%, for example), use A% = ASC(A$).
  902.  
  903. An 'int' or an 'unsigned int' is a 2-byte number, equivalent to BASIC's 
  904. INTEGER type (%).
  905.  
  906. A 'long' or an 'unsigned long' is a 4-byte integral number, equivalent to 
  907. QuickBASIC's LONG INTEGER type (&).
  908.  
  909. A 'double' is an 8-byte floating point number, equivalent to BASIC's DOUBLE 
  910. type (#).  NOTE: older versions of Microsoft's QuickBASIC store DOUBLEs in 
  911. Microsoft Binary format, remember, these are in IEEE format - 4.0+ of 
  912. QuickBASIC is fine.
  913.  
  914. A 'float' is a 4-byte floating point number, equivalent to BASIC's SINGLE 
  915. type (!).  NOTE: older versions of Microsoft's QuickBASIC store SINGLEs in 
  916. Microsoft Binary format, remember, these are in IEEE format - 4.0+ of 
  917. QuickBASIC is fine.
  918.  
  919. Any numerical type with a number in brackets after the variable name is an 
  920. array of the number of elements specified in brackets.  Two pairs of 
  921. brackets means a two-dimensional array, etc.
  922.  
  923. An 'unsigned char ....[]' value (unless it is literally an array of char 
  924. values) is a string.  The value in brackets is the max length of the 
  925. string.  However, all strings are null terminated.  First, this means that 
  926. the 'max length of the string' in brackets will actually be one more than 
  927. the true max length.  Second, at the end of all meaningful characters
  928. in the string, there will be a null (ASCII 0) character, followed by 
  929. unpredictable trash.  The strings are NOT padded with spaces!  When reading 
  930. in these "string" values, use a BASIC STRING of the length in the brackets, 
  931. and this command may be used afterwards to obtain a true BASIC string:
  932. REAL.STRING$ = LEFT$(STRING.FROM.FILE$, INSTR(STRING.FROM.FILE$, CHR$(0))-1)
  933. Some arrays of unsigned char are not actually strings, but as mentioned 
  934. earlier, literally arrays of char values, and when this is the case, it is 
  935. mentioned in the description of that structure in this document.
  936.  
  937. Information for Pascal Programmers
  938. ----------------------------------
  939.  
  940. An 'unsigned char' type corresponds to Turbo Pascal's byte type.
  941.  
  942. A 'char' type corresponds to Turbo Pascal's shortint type.
  943.  
  944. An 'unsigned int' type corresponds to Turbo Pascal's word type.
  945.  
  946. An 'int' type corresponds to Turbo Pascal's integer type.
  947.  
  948. An 'unsigned long' or 'long' type corresponds to Turbo Pascal's longint type.
  949.  
  950. A 'double' is an 8-bit floating point type, and a 'float' is a 4-bit 
  951. floating point type.  Their Pascal equivalent types vary widely.  See your 
  952. compiler guide, and remember, these are in IEEE format.
  953.  
  954. Any numerical type with a number in brackets after the variable name is an 
  955. array of the number of elements specified in brackets.  Two pairs of 
  956. brackets means a two-dimensional array, etc.
  957.  
  958. An 'unsigned char ....[]' value (unless it is literally an array of char 
  959. values) is a string.  The value in brackets is the max length of the 
  960. string.  However, all strings are null terminated.  First, this means that 
  961. the 'max length of the string' in brackets will actually be one more than 
  962. the true max length.  Second, at the end of all meaningful characters
  963. in the string, there will be a null (ASCII 0) character, followed by 
  964. unpredictable trash.  The strings are NOT padded with spaces!  When reading 
  965. in these "string" values, use a packed array of char of the length in the 
  966. brackets.  The true length of the string will be the position of the first 
  967. ASCII 0 (null) minus one (assuming first char in the string is pos # 1).
  968. Some arrays of unsigned char are not actually strings, but as mentioned 
  969. earlier, literally arrays of char values, and when this is the case, it is 
  970. mentioned in the description of that structure in this document.
  971.